<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

// roster
Route::group('index',function(){
    Route::get('/test', 'Index/test');
});

// roster
Route::group('backed/roster',function(){
    Route::get('/list', 'backed.Roster/getRosterList');
    Route::get('/groupList', 'backed.Roster/getGroupList');
    Route::get('/all', 'backed.Roster/getAllRosters');
    Route::get('/info', 'backed.Roster/getRosterInfo');
});


// certificate
Route::group('backed/certificate',function(){
    Route::get('/list', 'backed.Certificate/getCertificates');
    Route::post('/insert', 'backed.Certificate/createCertificate');
    Route::post('/update', 'backed.Certificate/updateCertificate');
    Route::get('/delete', 'backed.Certificate/deleteCertificate');

});

// notice
Route::group('backed/notice',function(){
    Route::get('/list', 'backed.Notice/getNotices');
    Route::post('/insert', 'backed.Notice/createNotice');
    Route::post('/update', 'backed.Notice/updateNotice');
    Route::get('/delete', 'backed.Notice/deleteNotice');
});


// event
Route::group('backed/event',function(){
    Route::get('/list', 'backed.Event/getEvents');
    Route::post('/insert', 'backed.Event/createEvent');
    Route::get('/delete', 'backed.Event/deleteEvent');
});

// event
Route::group('backed/photo',function(){
    Route::get('/list', 'backed.Photo/getPhotos');
    Route::post('/insert', 'backed.Photo/createPhoto');
    Route::get('/delete', 'backed.Photo/deletePhoto');
});

// user-cert
Route::group('backed/user-cert',function(){
    Route::get('/list', 'backed.UserCert/getUserCerts');
    Route::post('/insert', 'backed.UserCert/createUserCert'); // 颁发证书
    Route::get('/delete', 'backed.UserCert/deleteUserCert');
    Route::get('/allCert', 'backed.UserCert/getAllCert');
});


// notice
Route::group('backed/notice',function(){
    Route::get('/list', 'backed.Notice/getNotices');
    Route::post('/insert', 'backed.Notice/createNotice');
    Route::post('/update', 'backed.Notice/updateNotice');
    Route::get('/delete', 'backed.Notice/deleteNotice');
});


// auth
Route::group('backed/passport',function(){
    Route::post('/login', 'backed.Passport/login');
    Route::get('/info', 'backed.Passport/info');
});

// roster
Route::group('oss',function(){
    Route::get('/list', 'Oss/upload');
});


// candidate
Route::group('backed/candidate',function(){
    Route::get('/comment-list', 'backed.Candidate/getCandidateComments');
    Route::get('/address-list', 'backed.Candidate/getAddressList');    
    Route::get('/list', 'backed.Candidate/getCandidates');
    Route::post('/insert', 'backed.Candidate/createCandidate'); // 创建候选人
    Route::post('/update', 'backed.Candidate/updateCandidate'); // 修改候选人
    Route::get('/delete', 'backed.Candidate/deleteCandidate'); // 删除候选人

    Route::get('/address', 'backed.Candidate/address'); // 批量修改面试地址
    Route::get('/testclear', 'backed.Candidate/testclear'); // 清空候选人性格测试数据
});

// candidate
Route::group('front/candidate',function(){
    Route::get('/info', 'front.Candidate/getCandidateInfo');
    Route::post('/login', 'front.Candidate/login');
    Route::get('/goDing', 'front.Candidate/goDing');
    Route::post('/comment', 'front.Candidate/submitComment');
    Route::post('/character', 'front.Candidate/character'); // 性格测试
    Route::get('/charaInfo', 'front.Candidate/getCharacter'); // 获取结果
});


// roster
Route::group('front/roster',function(){
    Route::post('/login', 'front.Roster/login');
    Route::get('/getUid', 'front.Roster/getUid');
    Route::get('/info', 'front.Roster/getRosterInfo');
    Route::get('/photo-list', 'front.Roster/getPhotoList');
    Route::get('/all', 'front.Roster/getRoters');
});


// notice
Route::group('front/notice',function(){
    Route::get('/get', 'front.Notice/getNotices');
});

// event
Route::group('front/event',function(){
    Route::get('/get', 'front.Event/getEvents');
});

// cert
Route::group('front/cert',function(){
    Route::get('/get', 'front.UserCert/getUserCerts');
    Route::get('/getCertificate', 'front.UserCert/getCertificate'); // 员工证书地图
});

// ding
Route::group('front/ding',function(){
    Route::get('/test', 'front.Ding/test');
});